rendernodeparser: Avoid gdk_texture_new_for_pixbuf
authorMatthias Clasen <mclasen@redhat.com>
Mon, 13 Sep 2021 23:36:17 +0000 (19:36 -0400)
committerBenjamin Otte <otte@redhat.com>
Thu, 16 Sep 2021 22:25:22 +0000 (00:25 +0200)
We can just use gdk_texture_new_from_bytes here now.

Update affected test output.

gsk/gskrendernodeparser.c

index fe5c55ac1eb6fc5442676e0dcadf4a2fe75349c3..ed08bd4431fde1f784fc4a3ae6ed95fe56d73551 100644 (file)
@@ -85,24 +85,17 @@ parse_texture (GtkCssParser *parser,
   scheme = g_uri_parse_scheme (url);
   if (scheme && g_ascii_strcasecmp (scheme, "data") == 0)
     {
-      GInputStream *stream;
-      GdkPixbuf *pixbuf;
       GBytes *bytes;
 
-      texture = NULL;
-
       bytes = gtk_css_data_url_parse (url, NULL, &error);
       if (bytes)
         {
-          stream = g_memory_input_stream_new_from_bytes (bytes);
+          texture = gdk_texture_new_from_bytes (bytes, &error);
           g_bytes_unref (bytes);
-          pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, &error);
-          g_object_unref (stream);
-          if (pixbuf != NULL)
-            {
-              texture = gdk_texture_new_for_pixbuf (pixbuf);
-              g_object_unref (pixbuf);
-            }
+        }
+      else
+        {
+          texture = NULL;
         }
     }
   else